package com.ruoyi.project.search.viewstockstatistics.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.search.viewstockstatistics.mapper.ViewStockStatisticsMapper;
import com.ruoyi.project.search.viewstockstatistics.domain.ViewStockStatistics;
import com.ruoyi.project.search.viewstockstatistics.service.IViewStockStatisticsService;
import com.ruoyi.common.core.text.Convert;

/**
 * 库存统计Service业务层处理
 * 
 * @author wld
 * @date 2023-06-03
 */
@Service
public class ViewStockStatisticsServiceImpl implements IViewStockStatisticsService 
{
    @Autowired
    private ViewStockStatisticsMapper viewStockStatisticsMapper;

    /**
     * 查询库存统计
     * 
     * @param warehousecode 库存统计主键
     * @return 库存统计
     */
    @Override
    public ViewStockStatistics selectViewStockStatisticsByWarehousecode(String warehousecode)
    {
        return viewStockStatisticsMapper.selectViewStockStatisticsByWarehousecode(warehousecode);
    }

    /**
     * 查询库存统计列表
     * 
     * @param viewStockStatistics 库存统计
     * @return 库存统计
     */
    @Override
    public List<ViewStockStatistics> selectViewStockStatisticsList(ViewStockStatistics viewStockStatistics)
    {
        return viewStockStatisticsMapper.selectViewStockStatisticsList(viewStockStatistics);
    }

    /**
     * 新增库存统计
     * 
     * @param viewStockStatistics 库存统计
     * @return 结果
     */
    @Override
    public int insertViewStockStatistics(ViewStockStatistics viewStockStatistics)
    {
        return viewStockStatisticsMapper.insertViewStockStatistics(viewStockStatistics);
    }

    /**
     * 修改库存统计
     * 
     * @param viewStockStatistics 库存统计
     * @return 结果
     */
    @Override
    public int updateViewStockStatistics(ViewStockStatistics viewStockStatistics)
    {
        return viewStockStatisticsMapper.updateViewStockStatistics(viewStockStatistics);
    }

    /**
     * 批量删除库存统计
     * 
     * @param warehousecodes 需要删除的库存统计主键
     * @return 结果
     */
    @Override
    public int deleteViewStockStatisticsByWarehousecodes(String warehousecodes)
    {
        return viewStockStatisticsMapper.deleteViewStockStatisticsByWarehousecodes(Convert.toStrArray(warehousecodes));
    }

    /**
     * 删除库存统计信息
     * 
     * @param warehousecode 库存统计主键
     * @return 结果
     */
    @Override
    public int deleteViewStockStatisticsByWarehousecode(String warehousecode)
    {
        return viewStockStatisticsMapper.deleteViewStockStatisticsByWarehousecode(warehousecode);
    }
}
